//package com.woniuxy.microsysserver.serurity.acl;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.woniuxy.microsysserver.serurity.acl.entity.Role;
//import com.woniuxy.microsysserver.serurity.aclservice.RoleService;
//import com.woniuxy.microsysserver.serurity.util.ResponseEntity;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.util.StringUtils;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * <p>
// *  前端控制器
// * </p>
// *
// * @author testjava
// * @since 2020-01-12
// */
//@RestController
//@RequestMapping("/admin/acl/role")
//public class RoleController {
//
//    @Autowired(required = false)
//    private RoleService roleService;
//
//    @ApiOperation(value = "获取角色分页列表")
//    @GetMapping("{page}/{limit}")
//    public ResponseEntity index(
//            @ApiParam(name = "page", value = "当前页码", required = true)
//            @PathVariable Long page,
//
//            @ApiParam(name = "limit", value = "每页记录数", required = true)
//            @PathVariable Long limit,
//            Role role) {
//        Page<Role> pageParam = new Page<>(page, limit);
//        QueryWrapper<Role> wrapper = new QueryWrapper<>();
//        if(!StringUtils.isEmpty(role.getRoleName())) {
//            wrapper.like("role_name",role.getRoleName());
//        }
//        roleService.page(pageParam,wrapper);
//        return ResponseEntity.ok().data("items", pageParam.getRecords()).data("total", pageParam.getTotal());
//    }
//
//    @ApiOperation(value = "获取角色")
//    @GetMapping("get/{id}")
//    public ResponseEntity get(@PathVariable String id) {
//        Role role = roleService.getById(id);
//        return ResponseEntity.ok().data("item", role);
//    }
//
//    @ApiOperation(value = "新增角色")
//    @PostMapping("save")
////    @ControllerLog(description = "新增角色",modular = "角色管理")
//    public ResponseEntity save(@RequestBody Role role) {
//        roleService.save(role);
//        return ResponseEntity.ok();
//    }
//
//    @ApiOperation(value = "修改角色")
//    @PutMapping("update")
////    @ControllerLog(description = "修改角色",modular = "角色管理")
//    public ResponseEntity updateById(@RequestBody Role role) {
//        roleService.updateById(role);
//        return ResponseEntity.ok();
//    }
//
//    @ApiOperation(value = "删除角色")
//    @DeleteMapping("remove/{id}")
////    @ControllerLog(description = "删除角色",modular = "角色管理")
//    public ResponseEntity remove(@PathVariable String id) {
//        roleService.removeById(id);
//        return ResponseEntity.ok();
//    }
//
//    @ApiOperation(value = "根据id列表删除角色")
//    @DeleteMapping("batchRemove")
////    @ControllerLog(description = "批量删除角色",modular = "角色管理")
//    public ResponseEntity batchRemove(@RequestBody List<String> idList) {
//        roleService.removeByIds(idList);
//        return ResponseEntity.ok();
//    }
//}
//
